package org.nobject.common.code.model.java;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * AnnotationModel
 *
 * @author bianrongjun
 * @version 1.0
 */
public class AnnotationModel {
	
	/** annotationName */
	public String annotationName;
	
	/** eles */
	private Map<String,Object> eles=new LinkedHashMap();
	
	public AnnotationModel(String annotationName){
		this.annotationName=annotationName;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		String s="@"+annotationName;
		if(eles.keySet().size()>0){
			s+="(";
			boolean start=false;
			for(String key:eles.keySet()){
				if(start) s+=",";
				s+=key+"="+eles.get(key);
				start=true;
			}
			s+=")";
		}
		return s;
	}
	
	
	public void addString(String key,String value){
		eles.put(key,"\""+value+"\"");
	}
	
	public void add(String key,String value){
		eles.put(key, value);
	}
	
}
